package org.example.simple_factory;

/**
 * @author Zhang Yu
 * @description: TODO
 * @date 2024/5/20 14:02
 */
public class OperationDiv extends Operation {
    @Override
    public double getResult() throws Exception {
        double result = 0;
        if (getNumberB() == 0) {
            throw new Exception("除数不能是0");
        }
        result = getNumberA() / getNumberB();
        return result;
    }
}
